﻿using System;
using System.Collections.Generic;

namespace 函数0
{
    class Program
    {
        static void SetX(ref int x)
        {
            x = 1;
        }

        static int Max(int x,int y)
        {
            return x > y ? x : y;
        }
        
        static bool FindNubOfArray(int nub,int[] array)
        {
            foreach (var item in array)
            {
                if (nub==item)
                {
                    return false;
                }
            }
            return false;
        }

        static int[] removeRepeatNub(int[] array)
        {
            List<int> newArray = new List<int>();
            for (int i = 0; i < array.Length; i++)
            {
                if (!FindNubOfArray(array[i], newArray.ToArray()))
                {
                    newArray.Add(array[i]);
                }
            }
            return newArray.ToArray();
        }

        static int fuc(int nLow,int nHight)
        {
            if(nHight==1)
            {
                return nLow;
            }

            return fuc(nLow, nHight - 1) * nLow;
        }

        static void Main(string[] args)
        {
            //int x = 1;
            //SetX(ref x);
            //Console.WriteLine($"x={x}");
            //Console.ReadLine();

            //int[] array = { 1, 2, 3, 2, 3, 4, 3, 4, 5 };
            //int[] res = removeRepeatNub(array);
            //foreach (var item in res)
            //{
            //    Console.WriteLine(item);
            //}

            int nl, nh;
            Console.WriteLine("输入某数的n次方");
            Console.Write("输入某数：");
            nl = int.Parse(Console.ReadLine());
            Console.Write("输入次数n：");
            nh = int.Parse(Console.ReadLine());
            Console.WriteLine($"{nl}的{nh}次方：{fuc(nl,nh)}");
            Console.ReadLine();
        }
    }
}
